package com.ntschy.sys.entity.dto.config;

import com.ntschy.common.core.entity.enums.SysWhetherEnum;
import com.ntschy.sys.entity.valid.SysConfigGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author ezreal_geng
 */
@Data
@ApiModel(description = "系统配置新增更新dto")
public class SysConfigAddUpdateDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "配置ID")
    @NotBlank(message = "配置ID不能为空", groups = SysConfigGroups.Update.class)
    @Length(min = 36, max = 36, message = "配置ID长度不合法", groups = SysConfigGroups.Update.class)
    private String id;

    @ApiModelProperty(value = "配置名称")
    @NotBlank(message = "配置名称", groups = {SysConfigGroups.Add.class, SysConfigGroups.Update.class} )
    @Length(max = 25, message = "配置名称不能超过25个字符")
    private String configName;

    @ApiModelProperty(value = "配置键")
    @NotBlank(message = "配置键", groups = {SysConfigGroups.Add.class, SysConfigGroups.Update.class} )
    @Length(max = 25, message = "配置键不能超过25个字符")
    private String configKey;

    @ApiModelProperty(value = "配置值")
    @NotBlank(message = "配置值", groups = {SysConfigGroups.Add.class, SysConfigGroups.Update.class} )
    @Length(max = 25, message = "配置值不能超过25个字符")
    private String configValue;

    @ApiModelProperty(value = "是否系统内置配置 0-否 1-是")
    private SysWhetherEnum configType;

    @ApiModelProperty(value = "备注")
    @NotBlank(message = "配置值", groups = {SysConfigGroups.Add.class, SysConfigGroups.Update.class} )
    @Length(max = 50, message = "系统配置备注不能超过50个字符")
    private String remark;

    
}
